vectorimage
Class VectorImage

java.lang.Object
  extended by vectorimage.VectorImage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RAWorld

public class VectorImage
extends java.lang.Object
implements java.io.Serializable

Vector image source class. Basically a collection of objects, an image size and an image background specification. Load it into a GVectorImage for a graphical representation.

Author:
Steven de Jong, steven.dejong@cs.unimaas.nl
See Also:
Serialized Form

Constructor Summary
VectorImage()
          Construct.
VectorImage(java.awt.Dimension size, java.awt.Color bgColor, java.util.Vector objects)
          Construct.
 
Method Summary
 void addObject(VectorObject obj)
          Add a VectorObject object.
 VectorObject findObjectAt(double x, double y)
          Find the topmost object that overlaps the point provided.
 java.awt.Color getBackground()
          Return the background colour of the image.
 GVectorObject[] getGVectorObjects(VectorObject vo)
          Return graphical representation(s) for the object given.
 java.util.Vector getObjects()
          Return the VectorObjectSources present in this image.
 java.awt.Dimension getSize()
          Return the size of the image.
 java.util.Vector getUsedColors()
          Get the colors that are used in this image.
 void removeObject(VectorObject obj)
          Remove a VectorObject object.
 void setBackground(java.awt.Color bgColor)
          Set the background colour of the image.
 void setSize(java.awt.Dimension size)
          Set the size of the image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorImage

public VectorImage()
Construct.


VectorImage

public VectorImage(java.awt.Dimension size,
                   java.awt.Color bgColor,
                   java.util.Vector objects)
Construct. The Vector should contain VectorObjects.

Method Detail

getSize

public java.awt.Dimension getSize()
Return the size of the image.


setSize

public void setSize(java.awt.Dimension size)
Set the size of the image.


getBackground

public java.awt.Color getBackground()
Return the background colour of the image.


setBackground

public void setBackground(java.awt.Color bgColor)
Set the background colour of the image.


getObjects

public java.util.Vector getObjects()
Return the VectorObjectSources present in this image.


addObject

public void addObject(VectorObject obj)
Add a VectorObject object.


removeObject

public void removeObject(VectorObject obj)
Remove a VectorObject object.


findObjectAt

public VectorObject findObjectAt(double x,
                                 double y)
Find the topmost object that overlaps the point provided.


getUsedColors

public java.util.Vector getUsedColors()
Get the colors that are used in this image.


getGVectorObjects

public GVectorObject[] getGVectorObjects(VectorObject vo)
Return graphical representation(s) for the object given.